/*****************************************************************************
*        描述 :
*             文件描述
*        CLR版本:            3.5
*        创建者 :            蒋 光
*        个人域名:           jiangguang.net.cn
*        命名空间名称:       ECP.Interface
*        文件名:             IPermissionService.cs
*        创建系统时间:       2012/11/2 19:07:01
*        创建年份:           2012
*
/*****************************************************************************/

namespace ECP.Interface
{
    using System.Data;
    using System.ServiceModel;
    using ECP.Utilities;

    [ServiceContract(Namespace = "http://jiangguang.net.cn/"), XmlSerializerFormat]
    public interface IPermissionService
    {
        [OperationContract]
        DataTable GetLicensePermissionByUser(BaseUserInfo userInfo, string userID);

        [OperationContract]
        DataTable GetModuleDT(BaseUserInfo userInfo);

        [OperationContract]
        DataTable GetModuleDTByPermission(BaseUserInfo userInfo, string userID, string permissionCode);

        [OperationContract]
        DataTable GetModuleDTByUser(BaseUserInfo userInfo, string userID);

        [OperationContract]
        DataTable GetOrganizeDTByPermission(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        string[] GetOrganizeIDsByPermission(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        DataTable GetPermissionDT(BaseUserInfo userInfo);

        [OperationContract]
        DataTable GetPermissionDTByPermission(BaseUserInfo userInfo, string userID, string permissionCode);

        [OperationContract]
        DataTable GetPermissionDTByUser(BaseUserInfo userInfo, string userID);

        [OperationContract]
        string[] GetResourcePermissionIDs(BaseUserInfo userInfo, string resourceCategory, string resourceID);

        [OperationContract]
        string[] GetResourceScopeTargetIDs(BaseUserInfo userInfo, string resourceCategory, string resourceID, string targetCategory, string permissionCode);

        [OperationContract]
        DataTable GetRoleDTByPermission(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        string[] GetRoleIDsByPermission(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        string[] GetRoleLicensePermissionIDs(BaseUserInfo userInfo, string roleID);

        [OperationContract]
        string[] GetRolePermissionIDs(BaseUserInfo userInfo, string roleID);

        [OperationContract]
        string[] GetRoleScopeModuleIDs(BaseUserInfo userInfo, string roleID, string permissionCode);

        [OperationContract]
        string[] GetRoleScopeOrganizeIDs(BaseUserInfo userInfo, string roleID, string permissionID);

        [OperationContract]
        DataTable GetUserDTByPermission(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        string[] GetUserIDsByPermission(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        string[] GetUserLicensePermissionIDs(BaseUserInfo userInfo, string userID);

        [OperationContract]
        string[] GetUserPermissionIDs(BaseUserInfo userInfo, string userID);

        [OperationContract]
        PermissionScope GetUserPermissionScope(BaseUserInfo userInfo, string userID, string permissionScopeCode);

        [OperationContract]
        string[] GetUserScopeModuleIDs(BaseUserInfo userInfo, string userID, string permissionCode);

        [OperationContract]
        string[] GetUserScopeOrganizeIDs(BaseUserInfo userInfo, string userID, string permissionID);

        [OperationContract]
        string[] GetUserScopeRoleIDs(BaseUserInfo userInfo, string userID, string permissionID);

        [OperationContract]
        string[] GetUserScopeUserIDs(BaseUserInfo userInfo, string userID, string permissionID);

        [OperationContract]
        int GrantResourcePermission(BaseUserInfo userInfo, string resourceCategory, string resourceID, string[] grantPermissionIDs);

        [OperationContract]
        int GrantResourceTargetScope(BaseUserInfo userInfo, string resourceCategory, string resourceID, string targetCategory, string[] grantTargetIDs, string permissionID);

        [OperationContract]
        int GrantRoleLicensePermission(BaseUserInfo userInfo, string roleID, string[] grantPermissionIDs);

        [OperationContract]
        int GrantRoleModuleScope(BaseUserInfo userInfo, string roleID, string[] grantModuleIDs);

        [OperationContract]
        int GrantRoleOrganizeScope(BaseUserInfo userInfo, string roleID, string permissionID, string[] grantOrganizeIDs);

        [OperationContract]
        int GrantRolePermission(BaseUserInfo userInfo, string roleID, string[] grantPermissionIDs);

        [OperationContract]
        int GrantUserLicensePermission(BaseUserInfo userInfo, string userID, string[] grantPermissionIDs);

        [OperationContract]
        int GrantUserModuleScope(BaseUserInfo userInfo, string userID, string[] grantModuleIDs);

        [OperationContract]
        int GrantUserOrganizeScope(BaseUserInfo userInfo, string userID, string permissionID, string[] grantOrganizeIDs);

        [OperationContract]
        int GrantUserPermission(BaseUserInfo userInfo, string userID, string[] grantPermissionIDs);

        [OperationContract]
        int GrantUserRoleScope(BaseUserInfo userInfo, string userID, string permissionID, string[] grantRoleIDs);

        [OperationContract]
        int GrantUserUserScope(BaseUserInfo userInfo, string userID, string permissionID, string[] grantUserIDs);

        [OperationContract]
        bool IsAdministrator(BaseUserInfo userInfo);

        [OperationContract]
        bool IsAdministratorByUser(BaseUserInfo userInfo, string userID);

        [OperationContract]
        bool IsAuthorized(BaseUserInfo userInfo, string permissionCode);

        [OperationContract]
        bool IsAuthorizedByUser(BaseUserInfo userInfo, string userID, string permissionCode);

        [OperationContract]
        bool IsInRole(BaseUserInfo userInfo, string userID, string roleName);

        [OperationContract]
        void Load();

        [OperationContract]
        bool ModuleIsAuthorized(BaseUserInfo userInfo, string moduleCode);

        [OperationContract]
        bool ModuleIsAuthorizedByUser(BaseUserInfo userInfo, string userID, string moduleCode);

        [OperationContract]
        int RevokeResourcePermission(BaseUserInfo userInfo, string resourceCategory, string resourceID, string[] revokePermissionIDs);

        [OperationContract]
        int RevokeResourceTargetScope(BaseUserInfo userInfo, string resourceCategory, string resourceID, string targetCategory, string[] revokeTargetIDs, string permissionID);

        [OperationContract]
        int RevokeRoleLicensePermission(BaseUserInfo userInfo, string roleID, string[] revokePermissionIDs);

        [OperationContract]
        int RevokeRoleModuleScope(BaseUserInfo userInfo, string roleID, string[] revokeModuleIDs);

        [OperationContract]
        int RevokeRoleOrganizeScope(BaseUserInfo userInfo, string roleID, string permissionID, string[] revokeOrganizeIDs);

        [OperationContract]
        int RevokeRolePermission(BaseUserInfo userInfo, string roleID, string[] revokePermissionIDs);

        [OperationContract]
        int RevokeUserLicensePermission(BaseUserInfo userInfo, string userID, string[] revokePermissionIDs);

        [OperationContract]
        int RevokeUserModuleScope(BaseUserInfo userInfo, string userID, string[] revokeModuleIDs);

        [OperationContract]
        int RevokeUserOrganizeScope(BaseUserInfo userInfo, string userID, string permissionID, string[] revokeOrganizeIDs);

        [OperationContract]
        int RevokeUserPermission(BaseUserInfo userInfo, string userID, string[] revokePermissionIDs);

        [OperationContract]
        int RevokeUserRoleScope(BaseUserInfo userInfo, string userID, string permissionID, string[] revokeRoleIDs);

        [OperationContract]
        int RevokeUserUserScope(BaseUserInfo userInfo, string userID, string permissionID, string[] revokeUserIDs);
    }
}